package oop5.printer;

public class Printer {
	// 价格和品牌
	private String brand;
	private int price;
	// 具有这两个接口
	private Paper paper;
	private InkBox ink;

	public Printer(String brand, int price) {
		super();
		this.brand = brand;
		this.price = price;
	}

	// 》》》安上纸张
	public void setPaper(Paper p) {
		this.paper = p;
	}

	// 安上魔术
	public void setInk(InkBox b) {
		this.ink = b;
	}

	public void work(String str) {
		System.out.println("价值" + price + "元的" + brand + "的打印机开始工作了。。。");
		System.out.println("用" + ink.getColor() + "来打印");
		paper.print();
		System.out.println("打印了。。。" + str);
	}
}
